package com.xqboss.apps.controller.system;

import com.xqboss.apps.service.sys.SysAppVersionService;
import com.xqboss.common.annotation.Anonymous;
import com.xqboss.common.core.controller.BaseController;
import com.xqboss.common.core.domain.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * app版本管理接口
 *
 * @author wangcong
 * @date 2023-09-04
 */
@Api(tags = "app版本管理")
@RestController
@RequestMapping("/apps/version")
public class SysAppVersionController extends BaseController {
    @Autowired
    private SysAppVersionService sysAppVersionService;

    @Anonymous
    @ApiOperation("验证是否最新版本")
    @GetMapping("/verifyApp")
    public R verifyApp(@ApiParam(name = "versionCode", value = "内部版本号", required = false)
                       @RequestParam String versionCode,
                       @ApiParam(name = "appCode", value = "01 安卓，02 IOS", required = true)
                       @RequestParam String appCode) {
        return R.ok(sysAppVersionService.verifyApp(versionCode, appCode));
    }
}
